Characterizing a sensing circuit of a data storage device

ABSTRACT

A data storage device is disclosed comprising a disk, a head for accessing the disk, and a sensor for generating an alternating sensor signal. The sensor is disconnected from an input of a sensing circuit and while the sensor is disconnected an alternating calibration signal is injected into the input of the sensing circuit, wherein the alternating calibration signal comprises a predetermined offset and amplitude. A response of the sensing circuit to the alternating calibration signal is evaluated to detect at least one of an offset and a gain of the sensing circuit.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a divisional of U.S. patent application Ser. No.15/063,696, filed on Mar. 8, 2016, which is hereby incorporated byreference in its entirety.

BACKGROUND

Disk drives comprise a disk and a head connected to a distal end of anactuator arm which is rotated about a pivot by a voice coil motor (VCM)to position the head radially over the disk. The disk comprises aplurality of radially spaced, concentric tracks for recording user datasectors and embedded servo sectors. The embedded servo sectors comprisehead positioning information (e.g., a track address) which is read bythe head and processed by a servo controller to control the velocity ofthe actuator arm as it seeks from track to track.

An air bearing forms between the head and the disk due to the diskrotating at high speeds. Since the quality of the write/read signaldepends on the fly height of the head, conventional heads (e.g.,magnetoresistive heads) may comprise an actuator for controlling the flyheight. Any suitable fly height actuator may be employed, such as aheater which controls fly height through thermal expansion, or apiezoelectric (PZT) actuator. It is desirable to determine theappropriate fly height actuator control signal (e.g., appropriatecurrent applied to a heater) that achieves the target fly height for thehead.

A data storage device may comprise one or more sensors used for anysuitable purpose, such as to determine the control signal applied to thefly height actuator that causes the head to contact the disk surface(touchdown detection). The operating fly height may then be achieved bybacking off from the fly height actuator control signal that causestouchdown. In another application, a sensor may be fabricated within thehead to detect defects on the disk surface, such as asperities,scratches, pits, etc.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A shows a data storage device in the form of a disk driveaccording to an embodiment comprising a disk and a head for accessingthe disk.

FIG. 1B shows control circuitry according to an embodiment comprising asensing circuit having an input connected to an alternating calibrationsignal having a predetermined offset and amplitude.

FIG. 1C is a flow diagram according to an embodiment wherein the outputof the sensor is evaluated to detect at least one of an offset and again of the sensing circuit in response to the alternating calibrationsignal.

FIG. 2A shows control circuitry according to an embodiment wherein acounter counts a number of times the alternating calibration signalexceeds a threshold.

FIG. 2B shows an embodiment wherein different signal levels for thealternating calibration signal are detected by adjusting the threshold.

FIG. 3 is a flow diagram according to an embodiment wherein fivedifferent signal levels for the alternating calibration signal aredetected by adjusting the threshold.

FIG. 4 is a flow diagram according to an embodiment wherein an offsetparameter and a gain parameter of the sensing circuit is adjusted basedon at least one of the detected signal levels.

FIG. 5A shows an embodiment wherein the offset parameter of the sensingcircuit comprises an offset added to the input setting of adigital-to-analog converter (DAC) and the gain parameter comprises again setting for an amplifier.

FIG. 5B shows an embodiment wherein the offset added to the inputsetting of the DAC is generated as a function of the input setting.

FIG. 5C shows an embodiment wherein the offset parameter of the sensingcircuit comprises an offset added to the alternating sensor signal.

FIG. 6 shows a sensing circuit according to an embodiment configured todetect positive and negative peaks of the alternating sensor signal.

FIG. 7 is a flow diagram according to an embodiment wherein an amplitudeof the alternating calibration signal is adjusted in order to adjust anon-linear parameter of the sensing circuit (e.g., the DAC).

DETAILED DESCRIPTION

FIG. 1A shows a data storage device in the form of a disk driveaccording to an embodiment comprising a disk 2, a head 4 for accessingthe disk 2, and a sensor 6 (FIG. 1B) for generating an alternatingsensor signal 8. The disk drive further comprises control circuitry 10configured to execute the flow diagram of FIG. 1C, wherein the sensor 6is disconnected from an input 11 of a sensing circuit 12 (block 14) andwhile the sensor 6 is disconnected an alternating calibration signal 16is injected into the input 11 of the sensing circuit 12 (block 20),wherein the alternating calibration signal 16 comprises a predeterminedoffset and amplitude. A response of the sensing circuit 12 to thealternating calibration signal 16 is evaluated to detect at least one ofan offset and a gain of the sensing circuit 12 (block 22).

The sensing circuit 12 in FIG. 1B may process any suitable alternatingsensor signal 8 generated by any suitable sensor 6 during normaloperation of the disk drive. For example, in one embodiment the sensor 6may comprise a fly height sensor or a touchdown sensor integrated intothe slider of the head 4, wherein an amplitude of the alternating sensorsignal 8 may represent a fly height (or touchdown) of the head 4 overthe disk 2. In another embodiment, the sensor 6 may be the read elementintegrated into the slider of the head 4 (e.g., a magnetoresistive (MR)read element), wherein the alternating sensor signal 8 may represent theread signal when reading data from the disk. In yet another embodiment,the sensor 6 may comprise a component of an actuator configured toactuate the head 4 over the disk 2, such as a voice coil motor (VCM)and/or a microactuator integrated into the head 4, the head gimbalassembly (HGA), or the suspension.

Regardless as to the type of sensor 6 employed, in one embodiment thesensing circuit 12 may exhibit an unknown offset and/or gain due, forexample, to manufacturing tolerances and/or changes in environmentalconditions, such as changes in temperature. Accordingly, in oneembodiment the offset and/or gain of the sensing circuit 12 may bedetected by injecting an alternating calibration signal 16 into thesensing circuit 12 and evaluating the response. In one embodiment, aparameter of the sensing circuit 12 may be adjusted based on at leastone of the detected offset and/or the detected gain so that the sensingcircuit 12 exhibits a nominal response to the alternating sensor signal8 during normal operation of the disk drive. Any suitable controlcircuitry may be employed to generate the alternating calibration signal16 at block 18 of FIG. 1B, such as any suitable oscillator circuitcomprising a suitable resonant element (e.g., capacitor, inductor,piezoelectric, crystal, etc.).

In the embodiment of FIG. 1B, any suitable sensing circuit 12 andoffset/gain detector 24 may be employed in the embodiments, such as thecontrol circuitry shown in FIG. 2A wherein the input 11 of the sensingcircuit is amplified by a gain circuit 26. The amplified signal 28 iscompared at comparator 30 to a threshold voltage 32 generated by adigital-to-analog converter (DAC) 34 which is configured based on aprogrammable input setting 36. In the embodiment of FIG. 2A, a counter38 is incremented each time the amplified signal 28 exceeds thethreshold voltage 32 at the comparator 30, wherein the output of thecounter 38 may be evaluated after a predetermined interval in order todetect the amplitude of the alternating sensor signal 8.

Any of the analog components in the sensing circuit 12 of FIG. 2A mayexhibit an unknown offset and/or gain that may impact the accuracy ofthe output, such as the gain circuit 26, the comparator 30 and/or theDAC 34. For example, an uncompensated offset and/or gain in the sensingcircuit 12 may translate into an abnormally large signal amplitudedetected by the counter 38. Accordingly, in one embodiment the offsetand/or gain of the sensing circuit 12 is detected by injecting analternating calibration signal 16 into the input 11 and evaluating theresponse of the sensing circuit 12.

FIG. 2B shows an example alternating calibration signal 16 having apredetermined positive offset and a predetermined amplitude that isinjected into the input 11 of the sensing circuit 12. FIG. 3 is a flowdiagram according to an embodiment for detecting at least one of theoffset and/or gain of the sensing circuit 12 which is understood withreference to FIG. 2B. The threshold 32 of the sensing circuit 12 isinitialized to zero (block 40) and the counter 38 is read (block 42)after a predetermined interval. If the count value does not exceed zero(block 44), then the threshold 32 is increased and the flow diagramrepeated until the count value does exceed zero at block 44) at whichpoint the threshold 32 represents the INIT level shown in FIG. 2B. Inone embodiment, the counter 38 is reset and a similar operation executed(blocks 48) until the count value exceeds a predetermined value (“a”value) at which point the threshold 32 presents the BASE level shown inFIG. 2B. In one embodiment, the counter 38 is reset after each intervalsuch that the flow at blocks 48 terminates when the count value exceedsthe “a” value over the predetermined interval. The counter 38 is resetand a similar operation executed (blocks 50) until the count value fallsbelow a predetermined value (“n” value) at which point the threshold 32represents the SIG level shown in FIG. 2B. The counter 38 is reset and asimilar operation executed (blocks 52) until the count value falls belowa predetermined value (“b” value) at which point the threshold 32represents the PEAK level shown in FIG. 2B. The counter 38 is reset anda similar operation executed (blocks 54) until the count value is zeroat which point the threshold 32 represents the FIN level shown in FIG.2B.

FIG. 4 is a flow diagram which extends on the flow diagram of FIG. 1C,wherein after determining the signal levels shown in FIG. 2B the offsetof the sensing circuit 12 may be detected based on the INIT thresholdand/or the BASE threshold, and a corresponding adjustment may be made(block 56) to compensated for the detected offset. In one embodiment,the offset of the sensing circuit 12 may be detected as the average ofthe INIT threshold and the BASE threshold. Referring again to FIG. 4,the gain of the sensing circuit 12 may be detected based on the SIGthreshold and/or the PEAK threshold, and a corresponding adjustment maybe made (block 58) to compensate for the detected gain error. In oneembodiment, the gain of the sensing circuit 12 may be detected based ona difference between the SIG threshold and the INIT threshold, and/orbased on a difference between the PEAK threshold and the BASE threshold,and/or based on an average of the differences. In one embodiment, offsetand/or gain adjustments may be made to the sensing circuit 12 until thesignal levels shown in FIG. 2B substantially match target levels for allfive signal levels (INIT, BASE, SIG, PEAK and FIN).

In one embodiment, a suitable parameter of the sensing circuit 12 may beadjusted to compensate for an error in the offset and/or the gain. FIG.5A shows an embodiment wherein an offset 60 that is added to the inputsetting 36 for the DAC 34 may be adjusted to compensate for an offseterror of the sensing circuit 12. Also in the embodiment of FIG. 5A, thegain 62 of the gain circuit 26 may be adjusted to compensate for a gainerror of the sensing circuit 12. In one embodiment, the offset 60 and/orthe gain 62 may be adjusted and the flow diagram of FIG. 3 repeateduntil the offset and/or gain of the sensing circuit 12 exhibit a nominalresponse as determined from the measured signal levels as shown in FIG.2B.

In one embodiment, the offset and/or gain of the sensing circuit 12 mayexhibit a non-linear error. For example, in one embodiment the DAC 34may exhibit a non-linear offset relative to the amplitude of the inputsetting 36. FIG. 5B shows an embodiment wherein the offset 60 added tothe input setting 36 of the DAC 34 may be generated as a function 64 ofthe input setting 36. In one embodiment, the function 64 may bedetermined by adjusting the amplitude of the alternating calibrationsignal 16 and measuring the signal levels as shown in FIG. 2B byexecuting the flow diagram of FIG. 3 at the different amplitude levelsof the alternating calibration signal.

In another embodiment shown in FIG. 5C, the offset of the sensingcircuit 12 may be adjusted in the analog domain, such as by adding ananalog offset 66 to the input 11 of the sensing circuit 12. In anotherembodiment, the analog offset 66 may be added to the output of the gaincircuit 26. In yet another embodiment, the analog offset 66 may be addedto the output of the DAC 34. Regardless as to how the offset and/or gainof the sensing circuit 12 are compensated, in one embodiment theadjustment to the sensing circuit 12 achieves a nominal response to thealternating calibration signal 16 and therefore a nominal response tothe alternating sensor signal 8 during normal operation of the diskdrive.

FIG. 6 shows a sensing circuit 12 according to an embodiment capable ofdetecting the positive and negative amplitude of a dual polarityalternating sensor signal 8. In the embodiment of FIG. 6, the componentsof the sensing circuit 12 described above with reference to FIG. 2A areduplicated in order to detect the negative amplitude of the alternatingsensor signal 8. An OR-gate 68 generates a combined signal 70 that isactive when the amplitude of the alternating sensor signal 8 exceedseither the positive threshold 32A at comparator 30A or the negativethreshold 32B at comparator 30B. A multiplexer 72 is configured toselect the output from either comparator 30A or 30B or the combinedsignal 70 in order to drive the counter 38. Accordingly, the counter 38may count the threshold crossings for either or both the positive ornegative amplitudes of the alternating sensor signal 8. In oneembodiment, the flow diagram of FIG. 3 may be executed to measure thesignal levels of the alternating calibration signal for either or bothof the positive or negative amplitudes. In one embodiment, the controlcircuitry may calibrate offset and/or gain adjustments for the sensingcircuit 12 that may be applied when sensing the positive amplitude orwhen sensing the negative amplitude. For example, the input setting 36of the DAC 34 may be adjusted using an offset 60 such as shown in FIG.5A depending on whether the sensing circuit 12 is configured to sensethe positive amplitude or the negative amplitude of the alternatingsensor signal 8. In another embodiment, an offset and/or gain adjustmentmay be made to both the positive amplitude leg and the negativeamplitude leg of the sensing circuit shown in FIG. 6 to enable thesimultaneous detection of both the positive amplitude and negativeamplitude of the alternating sensor signal 8.

FIG. 7 shows a flow diagram according to an embodiment which extends onthe flow diagram of FIG. 1C, wherein the amplitude of the alternatingcalibration signal is initialized, for example, to a low level (block74). The alternating calibration signal is then injected into the inputof the sensing circuit (block 14) in order to detect the offset and/orgain of the sensing circuit at the current amplitude of the alternatingcalibration signal (block 20). The flow diagram is then repeated afteradjusting (e.g., increasing) the amplitude of the alternatingcalibration signal (block 78). Once the offset and/or gain of thesensing circuit has been detected over a range of amplitudes for thealternating calibration signal (block 76), a non-linear parameter of thesensing circuit is adjusted in order to compensate for a non-linearresponse (block 80). For example, in one embodiment the DAC 34 mayexhibit a non-linear response to the amplitude of the input setting 36which may vary based on the amplitude of the alternating sensor signal 8being evaluated. Accordingly, in one embodiment the offset 60 added tothe input setting 36 may be generated as a function 64 of the inputsetting 36 as illustrated in FIG. 5B, wherein the function 64 may becalibrated by executing the flow diagram of FIG. 7.

In one embodiment, the offset and/or gain of the sensing circuit 12 mayvary due to changes in environmental conditions, such as changes intemperature. Accordingly, in one embodiment the response of the sensingcircuit 12 may be evaluated over different environmental conditions inorder to detect (and optionally compensate) for an offset and/or gainerror over the different environmental conditions. In one embodiment,the control circuitry may employ one or more environmental sensors(e.g., a temperature sensor) in order to adjust the offset and/or gaincompensation for the sensing circuit 12 during the normal operating modeof the disk drive as needed in response to changes in environmentalconditions.

In one embodiment, each production disk drive may comprise the controlcircuitry 18 shown in FIG. 1B needed to generate the alternatingcalibration signal 16. In this embodiment, each production disk drivemay measure the response of the sensing circuit 12 by generating andinjecting the alternating calibration signal 16 into the input 11 of thesensing circuit 12. In an alternative embodiment, each production diskdrive may be inserted into a manufacturing test station that comprisesthe control circuitry 18 shown in FIG. 1B needed to generate thealternating calibration signal 16 that is injected into the input 11 ofthe sensing circuit 12. Accordingly, in this embodiment the data storagedevice may comprise a production disk drive inserted into amanufacturing test station. In one embodiment, the manufacturing teststation may evaluate the measured response of the sensing circuit 12 inorder to configure each production disk drive with appropriatecompensation parameters, and in another embodiment the control circuitrywithin each production disk drive may measure the response and configurethe compensation parameters.

In one embodiment, the data storage device may comprise a manufacturingtest station that is used to perform any suitable manufacturing processon a plurality of production disk drives, such as a calibrating orscreening process. In one embodiment, there may be a number of similartest stations that perform the same calibrating or screening process ona number of the production disk drives in an assembly line fashion. Whencalibrating and/or screening the production disk drive, it may bedesirable for the sensing circuit 12 employed in each manufacturing teststation to exhibit essentially the same response in terms of offsetand/or gain so that the production disk drives are all calibratedsimilarly and/or screened out as defective using a consistent testcriteria. Accordingly, in one embodiment the sensing circuit 12 withineach manufacturing test station may be evaluated by executing the flowdiagram of FIG. 3 to detect the signal levels of the alternatingcalibration signal as shown in FIG. 2B. Each sensing circuit within eachmanufacturing test station may then be adjusted to exhibit essentiallythe same response in terms of offset and/or gain. In one embodiment, theflow diagram of FIG. 3 may be executed for each sensing circuit 12 priorto installing the sensing circuit 12 into a manufacturing test station.That is, there may be a dedicated station for measuring the response ofeach sensing circuit 12 and for configuring each sensing circuit 12 withcompensation values prior to inserting the sensing circuit 12 into themanufacturing test station used to test the production disk drives.

Any suitable control circuitry may be employed in a data storage deviceor test station to implement the flow diagrams in the above embodiments,such as any suitable integrated circuit or circuits. For example, thecontrol circuitry may be implemented within a read channel integratedcircuit, or in a component separate from the read channel, such as adisk controller, or certain operations described above may be performedby a read channel and others by a disk controller. In one embodiment,the read channel and disk controller are implemented as separateintegrated circuits, and in an alternative embodiment they arefabricated into a single integrated circuit or system on a chip (SOC).In addition, the control circuitry may include a suitable preamp circuitimplemented as a separate integrated circuit, integrated into the readchannel or disk controller circuit, or integrated into a SOC.

In one embodiment, the control circuitry comprises a microprocessorexecuting instructions, the instructions being operable to cause themicroprocessor to perform the flow diagrams described herein. Theinstructions may be stored in any computer-readable medium. In oneembodiment, they may be stored on a non-volatile semiconductor memoryexternal to the microprocessor, or integrated with the microprocessor ina SOC. In another embodiment, the instructions are stored on the diskand read into a volatile semiconductor memory when the disk drive ispowered on. In yet another embodiment, the control circuitry comprisessuitable logic circuitry, such as state machine circuitry.

In various embodiments, a disk drive may include a magnetic disk drive,an optical disk drive, etc. In addition, while the above examplesconcern a disk drive, the various embodiments are not limited to a diskdrive and can be applied to other data storage devices and systems, suchas test stations, magnetic tape drives, solid state drives, hybriddrives, etc. In addition, some embodiments may include electronicdevices such as computing devices, data server devices, media contentstorage devices, etc. that comprise the storage media and/or controlcircuitry as described above.

The various features and processes described above may be usedindependently of one another, or may be combined in various ways. Allpossible combinations and subcombinations are intended to fall withinthe scope of this disclosure. In addition, certain method, event orprocess blocks may be omitted in some implementations. The methods andprocesses described herein are also not limited to any particularsequence, and the blocks or states relating thereto can be performed inother sequences that are appropriate. For example, described tasks orevents may be performed in an order other than that specificallydisclosed, or multiple may be combined in a single block or state. Theexample tasks or events may be performed in serial, in parallel, or insome other manner. Tasks or events may be added to or removed from thedisclosed example embodiments. The example systems and componentsdescribed herein may be configured differently than described. Forexample, elements may be added to, removed from, or rearranged comparedto the disclosed example embodiments.

While certain example embodiments have been described, these embodimentshave been presented by way of example only, and are not intended tolimit the scope of the inventions disclosed herein. Thus, nothing in theforegoing description is intended to imply that any particular feature,characteristic, step, module, or block is necessary or indispensable.Indeed, the novel methods and systems described herein may be embodiedin a variety of other forms; furthermore, various omissions,substitutions and changes in the form of the methods and systemsdescribed herein may be made without departing from the spirit of theembodiments disclosed herein.

What is claimed is:
 1. A data storage device comprising: a disk; a headfor accessing the disk; a sensor for generating an alternating sensorsignal; and control circuitry comprising a sensing circuit, the controlcircuitry configured to disconnect the sensor from an input of thesensing circuit and while the sensor is disconnected from the input ofthe sensing circuit: inject an alternating calibration signal into theinput of the sensing circuit, wherein the alternating calibration signalcomprises a predetermined offset and amplitude; initialize a thresholdto an initial setting; first count a number of times the alternatingcalibration signal exceeds the initial threshold; adjust the threshold;second count a number of times the alternating calibration signalexceeds the adjusted threshold; and detect at least one of an offset anda gain of the sensing circuit based at least on the second count.
 2. Thedata storage device as recited in claim 1, wherein the control circuitryis further configured to adjust a parameter of the sensing circuit basedon at least one of the detected offset and the detected gain of thesensing circuit.
 3. The data storage device as recited in claim 2,wherein: the sensing circuit comprises a comparator for comparing thealternating sensor signal to a threshold; and the parameter comprisesthe threshold.
 4. The data storage device as recited in claim 2,wherein: the sensing circuit comprises an adder for adding an offset tothe alternating sensor signal; and the parameter comprises the addedoffset.
 5. The data storage device as recited in claim 2, wherein: thesensing circuit comprises an amplifier for amplifying the alternatingsensor signal; and the parameter comprises a gain of the amplifier. 6.The data storage device as recited in claim 1, wherein while the sensoris disconnected from the input of the sensing circuit, the controlcircuitry is further configured to adjust the threshold until the secondcount is at least one.
 7. The data storage device as recited in claim 1,wherein while the sensor is disconnected from the input of the sensingcircuit, the control circuitry is further configured to adjust thethreshold until the second count rises above a predetermined level. 8.The data storage device as recited in claim 1, wherein while the sensoris disconnected from the input of the sensing circuit, the controlcircuitry is further configured to adjust the threshold until the secondcount falls below a predetermined level.
 9. The data storage device asrecited in claim 1, wherein while the sensor is disconnected from theinput of the sensing circuit, the control circuitry is furtherconfigured to: adjust an amplitude of the alternating calibrationsignal; and evaluate a response of the sensing circuit to the adjustedalternating calibration signal.
 10. The data storage device as recitedin claim 9, wherein while the sensor is disconnected from the input ofthe sensing circuit, the control circuitry is further configured toadjust a non-linear component of the sensing circuit based on theresponse of the sensing circuit to the adjusted alternating calibrationsignal.
 11. The data storage device as recited in claim 10, wherein thenon-linear component of the sensing circuit comprises adigital-to-analog converter.
 12. The data storage device as recited inclaim 1, further comprising a preamp circuit comprising the sensingcircuit.
 13. A method of operating a data storage device comprising ahead actuated over a disk, the method comprising disconnecting a sensorfrom an input of a sensing circuit and while the sensor is disconnectedfrom the input of the sensing circuit: injecting an alternatingcalibration signal into the input of the sensing circuit, wherein thealternating calibration signal comprises a predetermined offset andamplitude; initializing a threshold to an initial setting; firstcounting a number of times the alternating calibration signal exceedsthe initial threshold; adjusting the threshold; second counting a numberof times the alternating calibration signal exceeds the adjustedthreshold; and detecting at least one of an offset and a gain of thesensing circuit based at least on the second count.
 14. The method asrecited in claim 13, further comprising adjusting a parameter of thesensing circuit based on at least one of the detected offset and thedetected gain of the sensing circuit.
 15. The method as recited in claim14, wherein: the sensing circuit comprises a comparator for comparingthe alternating sensor signal to a threshold; and the parametercomprises the threshold.
 16. The method as recited in claim 14, wherein:the sensing circuit comprises an adder for adding an offset to thealternating sensor signal; and the parameter comprises the added offset.17. The method device as recited in claim 14, wherein: the sensingcircuit comprises an amplifier for amplifying the alternating sensorsignal; and the parameter comprises a gain of the amplifier.
 18. Themethod as recited in claim 13, wherein while the sensor is disconnectedfrom the input of the sensing circuit, the method further comprisesadjusting the threshold until the second count is at least one.
 19. Themethod as recited in claim 13, wherein while the sensor is disconnectedfrom the input of the sensing circuit, the method further comprisesadjusting the threshold until the second count rises above apredetermined level.
 20. The method as recited in claim 13, whereinwhile the sensor is disconnected from the input of the sensing circuit,the method further comprises adjusting the threshold until the secondcount falls below a predetermined level.
 21. The method as recited inclaim 13, wherein while the sensor is disconnected from the input of thesensing circuit, the method further comprises: adjusting an amplitude ofthe alternating calibration signal; and evaluating a response of thesensing circuit to the adjusted alternating calibration signal.
 22. Themethod as recited in claim 21, wherein while the sensor is disconnectedfrom the input of the sensing circuit, the method further comprisesadjusting a non-linear component of the sensing circuit based on theresponse of the sensing circuit to the adjusted alternating calibrationsignal.
 23. The method as recited in claim 22, wherein the non-linearcomponent of the sensing circuit comprises a digital-to-analogconverter.
 24. Control circuitry configured to measure at least one ofan offset and gain of a sensing circuit for use in a data storagedevice, the control circuitry configured to disconnect a sensor from aninput of the sensing circuit and while the sensor is disconnected fromthe input of the sensing circuit: inject an alternating calibrationsignal into the input of the sensing circuit, wherein the alternatingcalibration signal comprises a predetermined offset and amplitude;initialize a threshold to an initial setting; first count a number oftimes the alternating calibration signal exceeds the initial threshold;adjust the threshold; second count a number of times the alternatingcalibration signal exceeds the adjusted threshold; and detect at leastone of an offset and a gain of the sensing circuit based at least on thesecond count.